package com.ruicar.afs.cloud.bizcommon.print.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruicar.afs.cloud.bizcommon.print.entity.ComPrintFormManage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 打印模板管理表
 *
 * @author phong
 * @version 1.0
 * @created 2020/6/8 21:39
 */
public interface ComPrintFormManageMapper extends BaseMapper<ComPrintFormManage> {

    IPage<ComPrintFormManage> queryTemplates(IPage<ComPrintFormManage> page, @Param("vo") ComPrintFormManage vo);

    /**
     * 通过uniqueCode获取模板
     * @param uniqueCode
     * @return
     */
    @Select("select m.* from com_print_form_manage m,com_attachment_management n where m.attachment_sub_class = concat(n.id) and n.unique_code = #{uniqueCode} ")
    ComPrintFormManage getPrintFormManageByUniqueCode(@Param("uniqueCode") String uniqueCode);

}
